package com.example.webpractice.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.webpractice.dao.TijiaozuoyeDao;
import com.example.webpractice.po.TijiaozuoyePO;
import com.example.webpractice.vo.PageVo;
import com.example.webpractice.vo.Po2Vo;
import com.example.webpractice.vo.TijiaozuoyeListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("tijiaozuoyeService")
public class TijiaozuoyeService {

    @Autowired
    private TijiaozuoyeDao dao;

    public PageVo queryPage(int pages, int limit, QueryWrapper queryWrapper) {
        Page<TijiaozuoyePO> pagePO = dao.selectPage(new Page<>(pages, limit), queryWrapper);
        return Po2Vo.toVoPage(pagePO, TijiaozuoyeListVO.class);
    }

    public int deleteBatchIds(List list) {
        return dao.deleteByIds(list);
    }


}
